﻿@{
    ViewData["Title"] = "登录";
}

<section class="login-wrap">
    <form class="form-horizontal m15_t" id="form" onclick="return false">
        @*<div class="login-title">
            <img src="~/images/logo.png" />
        </div>*@
        <div class="login-cont">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <label for="account" class="gettext">用户名</label>
                        <input type="text" name="account" class="form-control gettext" placeholder="用户名" autocomplete="off" />
                    </div>

                    <div class="col-md-12 p15_t">
                        <label for="password" class="gettext">密码</label>
                        <input type="password" name="password" class="form-control gettext" placeholder="密码" autocomplete="off" />
                    </div>

                    <div class="col-md-4 text-right"></div>
                    <div class="col-md-12 p20_t">
                        <button class="btn btn-block btn-primary btn-lg gettext" onclick="return login()">登录</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>
@section footerScript{
    <script type="text/javascript">
        function login() {

            var cover = Topro.UI.Mask({
                obj: $("body"),
                opacity: 0.5
            });

            var data = $("#form").serializeJSON();

            $.post("/Account/Login", data, function (res) {
                if (res.success) {

                    Topro.UI.Tip_success("登录成功！");

                    setTimeout(function () {
                        window.location.href = "/Home/Index";
                    }, 500)

                } else {
                    Topro.UI.Tip_danger(res.message);
                }
                cover.Remove();
            });
        }
    </script>
}
